package 笔试真题;

import java.util.LinkedList;
import java.util.Scanner;

public class Baidu3 {
    public  static int ans = 0;
    public static int len = 0;
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt(); // 限制的大小
        String s = scanner.next();
        traceBack(new LinkedList<Character>(),0,n,m,s);
        System.out.println(ans);
    }

    private static void traceBack(LinkedList<Character> chars, int i, int n, int m, String s) {
        if(i>n) return;
        if(len == m) {
            ans ++;
            ans %= 1000000007;
        }
        for (int j = i; j < n ; j++) {
            if(!chars.contains(s.charAt(i))) len++;
            chars.add(s.charAt(j));
            traceBack(chars,j+1,n,m,s);
            int tempL = chars.size();
            chars.removeLast();
            if(chars.size()<tempL){
                len --;
            }

        }
    }
}
